package apiday04homework;

import collection.Point;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo2 {
    public static void main(String[] args) {
        /*
        File dir = new File(".");
        if (dir.isDirectory()) {
            File[] files = dir.listFiles(f->f.getName().startsWith("."));
            for (File file : files) {
                System.out.println(file.getName());
            }
        }else {
            System.out.println("不是目录");
        }

         */
        File dir = new File(".");
        if (dir.isDirectory()) {
            File[] files = dir.listFiles(new FileFilter() {
                @Override
                public boolean accept(File file) {
                    return file.getName().startsWith(".");
                }
            });
            for (File file : files) {
                System.out.println(file.getName());
            }
        }else{
            System.out.println("不是目录");
        }
    }
}
